package btp.SuryaSiddhanta.Planets;


public class CurrentDay {
	public static long getCurrentDay(HinduMeanLunarCalendar h){
		long years = Constants.YUGA/2 + h.getYear()-1;
		long months = years * 12 + h.getMonth() - 1;
		long intercalary = Constants.INTERCALARY_MONTHS*months/Constants.SOLAR_MONTHS;
		long lunarMonths = months + intercalary;
		long lunarDays = lunarMonths*30+h.getDay()-1;
		long omittedDays = Constants.OMITTED_LUNAR_DAYS*lunarDays/Constants.LUNAR_DAYS;
		//System.out.println(years+" "+months+" "+intercalary+" "+lunarMonths+" "+lunarDays+" "+omittedDays);
		return lunarDays - omittedDays;
	}

}
